class AppVersionController < ApplicationController

  def index
    app = AppVersion.where(platform: params[:platform]).order(ver: :desc).take
    if app.blank?
      render json: Success.new(
          ver: "",
          url: ""
      )
    else
      render json: Success.new(
          ver: app.ver,
          url: params[:platform].eql?("ios") ? "https://itunes.apple.com/app/id1161292359" : (app.path.url.prepend($img_host) rescue "")
      )
    end
  end
end
